﻿using HandyControl.Controls;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace VisionImage
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainView : HandyControl.Controls.GlowWindow
    {
        public MainView()
        {
            InitializeComponent();
            DataContext = new MainViewModel();
        }

        private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left && e.ClickCount == 1) // 确保是左键单击
            {
                if (sender is Image image && image.Tag is string imagePath)
                {
                    // 直接使用imagePath
                    Debug.WriteLine($"单击图片: {imagePath}");
                    new ImageBrowser(imagePath).ShowDialog();
                }
            }
        }
    }
}